<!DOCTYPE html>
<html lang="zh-CN">
  <head>
  <meta charset="UTF-8">
  <meta 
    name="viewport"
    content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
  <meta 
    http-equiv="X-UA-Compatible" 
    content="ie=edge">
  <meta 
    name="theme-color" 
    content="#fff" 
    id="theme-color">
  <meta 
    name="description" 
    content="hexoDemo用于介绍如何使用hexo">
  <link 
    rel="icon" 
    href="/">
  <title>02-Git的使用</title>
  
    
      <meta 
        property="og:title" 
        content="02-Git的使用">
    
    
      <meta 
        property="og:url" 
        content="https://zwl5670.gitee.io/2000/01/01/00-%E5%89%8D%E7%AB%AF%E5%B7%A5%E5%85%B7/02-Git%E7%9A%84%E4%BD%BF%E7%94%A8/index.html">
    
    
      <meta 
        property="og:img" 
        content="https://img.songhn.com/img/Y67gdd.png">
    
    
      <meta 
        property="og:img" 
        content="hexoDemo用于介绍如何使用hexo">
    
    
      <meta 
        property="og:type" 
        content="article">
      <meta 
        property="og:article:published_time" 
        content="2000-01-01">
      <meta 
        property="og:article:modified_time" 
        content="2023-03-14">
      <meta 
        property="og:article:author" 
        content="zwl5670">
      
        
          <meta 
            property="og:article:tag" 
            content="前端工具">
        
      
    
  
  
  <link rel="preload" href="//at.alicdn.com/t/font_1946621_i1kgafibvw.css" as="style" >
  <link rel="preload" href="//at.alicdn.com/t/font_1952792_89b4ac4k4up.css" as="style" >
  <link rel="preload" href="/css/main.css" as="style" >
  
  <link rel="modulepreload" href="//instant.page/5.1.0">
  
  <link rel="stylesheet" href="/css/main.css">
  
  <link rel="stylesheet" href="//at.alicdn.com/t/font_1946621_i1kgafibvw.css">
  
  <link rel="stylesheet" href="//at.alicdn.com/t/font_1952792_89b4ac4k4up.css">
  
  
  
    <link rel="stylesheet" href="/js/lib/lightbox/baguetteBox.min.css">
  
  <script>
    function loadScript(url, cb) {
      var script = document.createElement('script');
      script.src = url;
      if (cb) script.onload = cb;
      script.async = true;
      document.body.appendChild(script);
    }
    function loadCSS(href, data, attr) {
      var sheet = document.createElement('link');
      sheet.ref = 'stylesheet';
      sheet.href = href;
      sheet.dataset[data] = attr;
      document.head.appendChild(sheet);
    }
    function changeCSS(cssFile, data, attr) {
      var oldlink = document.querySelector(data);
      var newlink = document.createElement("link");
      newlink.setAttribute("rel", "stylesheet");
      newlink.setAttribute("href", cssFile);
      newlink.dataset.prism = attr;
      document.head.replaceChild(newlink, oldlink);
    }
  </script>
  
    
  
  <script>
    // control reverse button
    var reverseDarkList = {
      dark: 'light',
      light: 'dark'
    };
    var themeColor = {
      dark: '#1c1c1e',
      light: '#fff'
    }
    // get the data of css prefers-color-scheme
    var getCssMediaQuery = function() {
      return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
    };
    // reverse current darkmode setting function
    var reverseDarkModeSetting = function() {
      var setting = localStorage.getItem('user-color-scheme');
      if(reverseDarkList[setting]) {
        setting = reverseDarkList[setting];
      } else if(setting === null) {
        setting = reverseDarkList[getCssMediaQuery()];
      } else {
        return;
      }
      localStorage.setItem('user-color-scheme', setting);
      return setting;
    };
    // apply current darkmode setting
  </script>
  
    <script>
      var setDarkmode = function(mode) {
      var setting = mode || localStorage.getItem('user-color-scheme');
      if(setting === getCssMediaQuery()) {
        document.documentElement.removeAttribute('data-user-color-scheme');
        localStorage.removeItem('user-color-scheme');
        document.getElementById('theme-color').content = themeColor[setting];
        document.getElementById('theme-color').dataset.mode = setting;
      } else if(reverseDarkList[setting]) {
        document.documentElement.setAttribute('data-user-color-scheme', setting);
        document.getElementById('theme-color').content = themeColor[setting];
        document.getElementById('theme-color').dataset.mode = setting;
      } else {
        document.documentElement.removeAttribute('data-user-color-scheme');
        localStorage.removeItem('user-color-scheme');
        document.getElementById('theme-color').content = themeColor[getCssMediaQuery()];
        document.getElementById('theme-color').dataset.mode = getCssMediaQuery();
      }
    };
    setDarkmode();
    </script>
  
  
  
    <link rel="preload" href="/js/lib/lightbox/baguetteBox.min.js" as="script">
    <link rel="preload" href="/js/lib/lightbox/baguetteBox.min.css" as="style" >
  
  
    <link rel="preload" href="/js/lib/lozad.min.js" as="script">
  
  
  
  
  
  
<meta name="generator" content="Hexo 6.3.0"></head>

  <body>
    <div class="wrapper">
       
      <nav class="navbar">
  <div class="navbar-logo">
    <a class="navbar-logo-main" href="/">
      
      <span class="navbar-logo-dsc">前端面试</span>
      </a>
  </div>
  <div class="navbar-menu">
    
      <a 
        href="/" 
        class="navbar-menu-item">
        
          首页
        
      </a>
    
      <a 
        href="/archives" 
        class="navbar-menu-item">
        
          归档
        
      </a>
    
      <a 
        href="/tags" 
        class="navbar-menu-item">
        
          标签
        
      </a>
    
      <a 
        href="/categories" 
        class="navbar-menu-item">
        
          分类
        
      </a>
    
      <a 
        href="/about" 
        class="navbar-menu-item">
        
          关于
        
      </a>
    
      <a 
        href="/links" 
        class="navbar-menu-item">
        
          友链
        
      </a>
    
    <button 
      class="navbar-menu-item darknavbar navbar-menu-btn" 
      aria-label="Toggle dark mode"
      id="dark">
      <i class="iconfont icon-weather"></i>
    </button>
    <button 
      class="navbar-menu-item searchnavbar navbar-menu-btn" 
      aria-label="Toggle search"
      id="search">
      <!-- <i 
        class="iconfont icon-search" 
        style="font-size: 1.2rem; font-weight: 400;">
      </i> -->
      <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img"
        class="iconify iconify--ion" width="28" height="28" preserveAspectRatio="xMidYMid meet" viewBox="0 0 512 512">
        <path fill="none" stroke="currentColor" stroke-miterlimit="10" stroke-width="28"
          d="M256 80a176 176 0 1 0 176 176A176 176 0 0 0 256 80Z"></path>
        <path fill="none" stroke="currentColor" stroke-miterlimit="10" stroke-width="28"
          d="M232 160a72 72 0 1 0 72 72a72 72 0 0 0-72-72Z"></path>
        <path fill="none" stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="28"
          d="M283.64 283.64L336 336"></path>
      </svg>
    </button>
  </div>
</nav> 
      
      <div 
        id="local-search" 
        style="display: none">
        <input
          class="navbar-menu-item"
          id="search-input"
          placeholder="请输入搜索内容..." />
        <div id="search-content"></div>
      </div>
      
      <div class="section-wrap">
        <div class="container">
          <div class="columns">
            <aside class="left-column">
              
              <div class="card card-author">
                
  <img 
    src="https://img.songhn.com/img/Y67gdd.png" 
    class="author-img"
    width="88"
    height="88"
    alt="author avatar">

<p class="author-name">zwl5670</p>
<p class="author-description">前端学习资料</p>
<div class="author-message">
  <a 
    class="author-posts-count" 
    href="/archives">
    <span>215</span>
    <span>文章</span>
  </a>
  <a 
    class="author-categories-count" 
    href="/categories">
    <span>14</span>
    <span>分类</span>
  </a>
  <a 
    class="author-tags-count" 
    href="/tags">
    <span>14</span>
    <span>标签</span>
  </a>
</div>

              </div>
               <div class="sticky-tablet">
  
  
    <article class="display-when-two-columns spacer">
      <div class="card card-content toc-card">
        <div class="toc-header">
  <i 
    class="iconfont icon-menu" 
    style="padding-right: 2px;">
  </i>目录
</div>
<ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%B8%B8%E8%A7%81%E6%93%8D%E4%BD%9C"><span class="toc-text">常见操作</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%85%A8%E5%B1%80%E9%85%8D%E7%BD%AE%E7%94%A8%E6%88%B7%E4%BF%A1%E6%81%AF"><span class="toc-text">全局配置用户信息</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%88%86%E6%94%AF%E7%9A%84%E5%90%88%E5%B9%B6"><span class="toc-text">分支的合并</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%9C%BA%E6%99%AF%EF%BC%9A%E5%9F%BA%E4%BA%8Emaster%E5%88%86%E6%94%AF%E7%9A%84%E4%BB%A3%E7%A0%81%EF%BC%8C%E5%BC%80%E5%8F%91%E4%B8%80%E4%B8%AA%E6%96%B0%E7%9A%84%E7%89%B9%E6%80%A7"><span class="toc-text">场景：基于master分支的代码，开发一个新的特性</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%90%88%E5%B9%B6%E5%88%86%E6%94%AF%E6%97%B6%EF%BC%8C%E5%A6%82%E6%9E%9C%E5%AD%98%E5%9C%A8%E5%88%86%E5%8F%89"><span class="toc-text">合并分支时，如果存在分叉</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E8%A7%A3%E5%86%B3%E5%90%88%E5%B9%B6%E6%97%B6%E5%8F%91%E7%94%9F%E7%9A%84%E5%86%B2%E7%AA%81"><span class="toc-text">解决合并时发生的冲突</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%97%A5%E5%B8%B8%E6%93%8D%E4%BD%9C%E7%A7%AF%E7%B4%AF"><span class="toc-text">日常操作积累</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%BF%AE%E6%94%B9%E5%AF%86%E7%A0%81%EF%BC%88%E6%9B%B2%E7%BA%BF%E6%95%91%E5%9B%BD%EF%BC%89"><span class="toc-text">修改密码（曲线救国）</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%BF%AE%E6%94%B9%E5%B7%B2%E7%BB%8Fpush%E7%9A%84%E6%9F%90%E6%AC%A1commit%E7%9A%84%E4%BD%9C%E8%80%85%E4%BF%A1%E6%81%AF"><span class="toc-text">修改已经push的某次commit的作者信息</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%B0%86-branch1%E7%9A%84%E6%9F%90%E4%B8%AAcommit1%E5%90%88%E5%B9%B6%E5%88%B0branch2%E5%BD%93%E4%B8%AD"><span class="toc-text">将 branch1的某个commit1合并到branch2当中</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#20190118-%E4%BF%AE%E6%94%B9GitHub%E5%B7%B2%E6%8F%90%E4%BA%A4%E7%9A%84%E7%94%A8%E6%88%B7%E5%90%8D%E5%92%8C%E9%82%AE%E7%AE%B1"><span class="toc-text">20190118-修改GitHub已提交的用户名和邮箱</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#20200520-%E5%B0%86Git-%E9%A1%B9%E7%9B%AE%E8%BF%81%E7%A7%BB%E5%88%B0%E5%8F%A6%E4%B8%80%E4%B8%AA%E4%BB%93%E5%BA%93"><span class="toc-text">20200520-将Git 项目迁移到另一个仓库</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#2021-11-10-%E6%8F%90%E4%BA%A4%E4%BB%A3%E7%A0%81%E6%97%B6%EF%BC%8C%E7%BB%95%E8%BF%87-eslint-%E6%A3%80%E6%9F%A5"><span class="toc-text">2021-11-10-提交代码时，绕过 eslint 检查</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#2021-12-29-%E5%88%87%E6%8D%A2%E4%BB%93%E5%BA%93%E7%9A%84%E6%BA%90%E5%9C%B0%E5%9D%80"><span class="toc-text">2021-12-29-切换仓库的源地址</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#git%E5%AE%A2%E6%88%B7%E7%AB%AF%E6%8E%A8%E8%8D%90"><span class="toc-text">git客户端推荐</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%8E%A8%E8%8D%90%E4%B9%A6%E7%B1%8D"><span class="toc-text">推荐书籍</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%8E%A8%E8%8D%90%E8%BF%9E%E6%8E%A5"><span class="toc-text">推荐连接</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#2018-06"><span class="toc-text">2018-06</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E8%B5%9E%E8%B5%8F%E4%BD%9C%E8%80%85"><span class="toc-text">赞赏作者</span></a></li></ol>
      </div>
    </article>
  
  
  <article class="card card-content categories-widget">
    <div class="categories-card">
  <div class="categories-header">
    <i 
      class="iconfont icon-fenlei" 
      style="padding-right: 2px;">
    </i>分类
  </div>
  <div class="categories-list">
    
      <a href="/categories/%E5%89%8D%E7%AB%AF%E5%B7%A5%E5%85%B7/">
        <div class="categories-list-item">
          前端工具
          <span class="categories-list-item-badge">13</span>
        </div>
      </a>
    
      <a href="/categories/CSS%E5%9F%BA%E7%A1%80/">
        <div class="categories-list-item">
          CSS基础
          <span class="categories-list-item-badge">18</span>
        </div>
      </a>
    
      <a href="/categories/CSS%E8%BF%9B%E9%98%B6/">
        <div class="categories-list-item">
          CSS进阶
          <span class="categories-list-item-badge">9</span>
        </div>
      </a>
    
      <a href="/categories/HTML/">
        <div class="categories-list-item">
          HTML
          <span class="categories-list-item-badge">12</span>
        </div>
      </a>
    
      <a href="/categories/JS%E5%9F%BA%E7%A1%80/">
        <div class="categories-list-item">
          JS基础
          <span class="categories-list-item-badge">56</span>
        </div>
      </a>
    
      <a href="/categories/JS%E5%9F%BA%E7%A1%80ES6/">
        <div class="categories-list-item">
          JS基础ES6
          <span class="categories-list-item-badge">10</span>
        </div>
      </a>
    
      <a href="/categories/JS%E5%9F%BA%E7%A1%80%E5%BC%82%E6%AD%A5/">
        <div class="categories-list-item">
          JS基础异步
          <span class="categories-list-item-badge">11</span>
        </div>
      </a>
    
      <a href="/categories/JS%E8%BF%9B%E9%98%B6/">
        <div class="categories-list-item">
          JS进阶
          <span class="categories-list-item-badge">11</span>
        </div>
      </a>
    
      <a href="/categories/%E7%A7%BB%E5%8A%A8web/">
        <div class="categories-list-item">
          移动web
          <span class="categories-list-item-badge">3</span>
        </div>
      </a>
    
      <a href="/categories/CSS%E5%92%8CDOM/">
        <div class="categories-list-item">
          CSS和DOM
          <span class="categories-list-item-badge">6</span>
        </div>
      </a>
    
      <a href="/categories/Node/">
        <div class="categories-list-item">
          Node
          <span class="categories-list-item-badge">16</span>
        </div>
      </a>
    
      <a href="/categories/Vue%E5%9F%BA%E7%A1%80/">
        <div class="categories-list-item">
          Vue基础
          <span class="categories-list-item-badge">15</span>
        </div>
      </a>
    
      <a href="/categories/%E6%80%A7%E8%83%BD%E4%BC%98%E5%8C%96/">
        <div class="categories-list-item">
          性能优化
          <span class="categories-list-item-badge">7</span>
        </div>
      </a>
    
      <a href="/categories/%E5%89%8D%E7%AB%AF%E5%B7%A5%E7%A8%8B%E5%8C%96/">
        <div class="categories-list-item">
          前端工程化
          <span class="categories-list-item-badge">8</span>
        </div>
      </a>
    
  </div>
</div>
  </article>
  
  <article class="card card-content tags-widget">
    <div class="tags-card">
  <div class="tags-header">
    <i 
      class="iconfont icon-biaoqian" 
      style="padding-right: 2px;">
    </i>热门标签
  </div>
  <div class="tags-list">
    
      <a 
        href="/tags/JS%E5%9F%BA%E7%A1%80/" 
        title="JS基础">
        <div class="tags-list-item">JS基础</div>
      </a>
    
      <a 
        href="/tags/CSS%E5%9F%BA%E7%A1%80/" 
        title="CSS基础">
        <div class="tags-list-item">CSS基础</div>
      </a>
    
      <a 
        href="/tags/Node/" 
        title="Node">
        <div class="tags-list-item">Node</div>
      </a>
    
      <a 
        href="/tags/Vue%E5%9F%BA%E7%A1%80/" 
        title="Vue基础">
        <div class="tags-list-item">Vue基础</div>
      </a>
    
      <a 
        href="/tags/%E5%89%8D%E7%AB%AF%E5%B7%A5%E5%85%B7/" 
        title="前端工具">
        <div class="tags-list-item">前端工具</div>
      </a>
    
      <a 
        href="/tags/HTML/" 
        title="HTML">
        <div class="tags-list-item">HTML</div>
      </a>
    
      <a 
        href="/tags/JS%E8%BF%9B%E9%98%B6/" 
        title="JS进阶">
        <div class="tags-list-item">JS进阶</div>
      </a>
    
      <a 
        href="/tags/JS%E5%9F%BA%E7%A1%80%E5%BC%82%E6%AD%A5/" 
        title="JS基础异步">
        <div class="tags-list-item">JS基础异步</div>
      </a>
    
      <a 
        href="/tags/JS%E5%9F%BA%E7%A1%80ES6/" 
        title="JS基础ES6">
        <div class="tags-list-item">JS基础ES6</div>
      </a>
    
      <a 
        href="/tags/CSS%E8%BF%9B%E9%98%B6/" 
        title="CSS进阶">
        <div class="tags-list-item">CSS进阶</div>
      </a>
    
      <a 
        href="/tags/%E5%89%8D%E7%AB%AF%E5%B7%A5%E7%A8%8B%E5%8C%96/" 
        title="前端工程化">
        <div class="tags-list-item">前端工程化</div>
      </a>
    
      <a 
        href="/tags/%E6%80%A7%E8%83%BD%E4%BC%98%E5%8C%96/" 
        title="性能优化">
        <div class="tags-list-item">性能优化</div>
      </a>
    
      <a 
        href="/tags/CSS%E5%92%8CDOM/" 
        title="CSS和DOM">
        <div class="tags-list-item">CSS和DOM</div>
      </a>
    
      <a 
        href="/tags/%E7%A7%BB%E5%8A%A8web/" 
        title="移动web">
        <div class="tags-list-item">移动web</div>
      </a>
    
  </div>
</div>
  </article>
  
  
</div>
            </aside>
            <main class="main-column">
              
<article class="card card-content">
  <header>
    <h1 class="post-title">
      02-Git的使用
    </h1>
  </header>
  <div class="post-meta post-show-meta">
    <time datetime="1999-12-31T16:00:00.000Z">
      <i 
        class="iconfont icon-calendar" 
        style="margin-right: 2px;">
      </i>
      <span>2000-01-01</span>
    </time>
    
      <span class="dot"></span>
      
        <a 
          href="/categories/%E5%89%8D%E7%AB%AF%E5%B7%A5%E5%85%B7/" 
          class="post-meta-link">
          前端工具
        </a>
      
    
    
      <span class="dot"></span>
      <span>1.9k 字</span>
    
  </div>
  
    <div 
      class="post-meta post-show-meta" 
      style="margin-top: -10px;">
      <div style="display: flex; align-items: center;">
        <i 
          class="iconfont icon-biaoqian" 
          style="margin-right: 2px; font-size: 1.15rem;">
        </i>
        
          
          <a 
            href="/tags/%E5%89%8D%E7%AB%AF%E5%B7%A5%E5%85%B7/" 
            class="post-meta-link">
            前端工具
          </a>
        
      </div>
    </div>
  
  </header>
  <div 
    id="section" 
    class="post-content">
    <p><ArticleTopAd></ArticleTopAd></p>
<h2 id="常见操作"><a href="#常见操作" class="headerlink" title="常见操作"></a>常见操作</h2><h3 id="全局配置用户信息"><a href="#全局配置用户信息" class="headerlink" title="全局配置用户信息"></a>全局配置用户信息</h3><pre class="highlight"><span class="line">git config --global user.name &quot;smyhvae&quot;</span><br><span class="line"></span><br><span class="line">git config --global user.email &quot;smyhvae@163.com&quot;</span><br></pre>


<h2 id="分支的合并"><a href="#分支的合并" class="headerlink" title="分支的合并"></a>分支的合并</h2><h3 id="场景：基于master分支的代码，开发一个新的特性"><a href="#场景：基于master分支的代码，开发一个新的特性" class="headerlink" title="场景：基于master分支的代码，开发一个新的特性"></a>场景：基于master分支的代码，开发一个新的特性</h3><p>如果你直接在master分支上开发这个新特性，是不好的，万一你在开发<code>特性1</code>的时候，领导突然又要叫你去开发<code>特性2</code>，就不好处理了。难道开发的两个特性都提交到master？一会儿提交特性1的commit，一会儿提交特性2的commit？这会导致commit记录很混乱。</p>
<p>所以，我给你的建议做法是：给每个特性都单独建一个的新的分支。</p>
<p>比如说，我专门给<code>特性1</code>建一个分支<code>feature_item_recommend</code>。具体做法如下：</p>
<p>（1）基于master分支，创建一个新的分支，起名为<code>feature_item_recommend</code>：</p>
<pre class="highlight"><span class="line">$ git checkout -b feature_item_recommend</span><br><span class="line"></span><br><span class="line">Switched to a new branch &#x27;feature_item_recommend&#x27;</span><br></pre>

<p>上面这行命令，相当于：</p>
<pre class="highlight"><span class="line">$ git branch feature_item_recommend    // 创建新的分支</span><br><span class="line"></span><br><span class="line">$ git checkout feature_item_recommend  //切换到新的分支</span><br></pre>


<p>（2）在新的分支<code>feature_item_recommend</code>上，完成开发工作，并 commit 、push。</p>
<p>（3）将分支<code>feature_item_recommend</code>上的开发进度<strong>合并</strong>到master分支：</p>
<pre class="highlight"><span class="line">$ git checkout master  //切换到master分支</span><br><span class="line"></span><br><span class="line">$ git merge feature_item_recommend    //将分支 feature_item_recommend 的开发进度合并到 master 分支</span><br><span class="line"></span><br></pre>


<p>合并之后，<code>master</code>分支和<code>feature_item_recommend</code>分支会指向同一个位置。</p>
<p>（3）删除分支<code>feature_item_recommend</code>：</p>
<blockquote>
<p>既然 特性1 开发完了，也放心地提交到master了，那我们就可以将这个分支删除了。</p>
</blockquote>
<pre class="highlight"><span class="line">git branch -d feature_item_recommend</span><br></pre>

<p>注意，我们当前是处于<code>master</code>分支的位置，来删除<code>feature_item_recommend</code>分支。如果当前是处于<code>feature_item_recommend</code>分支，是没办法删除它自己的。</p>
<p>同理，当我转身去开发<code>特性2</code>的时候，也是采用同样的步骤。</p>
<h3 id="合并分支时，如果存在分叉"><a href="#合并分支时，如果存在分叉" class="headerlink" title="合并分支时，如果存在分叉"></a>合并分支时，如果存在分叉</h3><p><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="http://img.smyhvae.com/20180610_1650.png" class="lozad post-image"src="http://img.smyhvae.com/20180610_1650.png"></p>
<p>比如说上面这张图中，最早的时候，master分支是位于<code>C2</code>节点。我基于<code>C2</code>节点，new出一个新的分支<code>iss53</code>，我在<code>iss53</code>上提交了好几个commit。</p>
<p>现在，我准备把<code>iss53</code>上的几个commit合并到master上，此时发现，master分支已经前进到C4了。那该怎么合并呢？</p>
<p>合并的命令仍然是：</p>
<pre class="highlight"><span class="line">$ git checkout master</span><br><span class="line"></span><br><span class="line">$ git merge iss53</span><br></pre>

<p><strong>解释</strong>：</p>
<p>这次合并的实现，并不同于简单的并入方式。这一次，我的开发历史是从更早的地方开始分叉的。</p>
<p>由于当前 master 分支所指向的commit (C4)并非想要并入分支（iss53）的直接祖先，Git 不得不进行一些处理。就此例而言，Git 会用两个分支的末端（C4 和C5）和它们的共同祖先（C2）进行一次简单的三方合并计算。</p>
<p>Git 没有简单地把分支指针右移，而是对三方合并的结果作一新的快照，并自动创建一个指向它的commit（C6）（如下图所示）。我们把这个特殊的commit 称作合并提交（mergecommit），因为它的祖先不止一个。</p>
<p>值得一提的是Git 可以自己裁决哪个共同祖先才是最佳合并基础；这和CVS 或Subversion（1.5 以后的版本）不同，它们需要开发者手工指定合并基础。所以此特性让Git 的合并操作比其他系统都要简单不少。</p>
<p><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="http://img.smyhvae.com/20180610_1710.png" class="lozad post-image"src="http://img.smyhvae.com/20180610_1710.png"></p>
<h3 id="解决合并时发生的冲突"><a href="#解决合并时发生的冲突" class="headerlink" title="解决合并时发生的冲突"></a>解决合并时发生的冲突</h3><p><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="http://img.smyhvae.com/20180610_1740.png" class="lozad post-image"src="http://img.smyhvae.com/20180610_1740.png"></p>
<p>如果 feature1和feature2修改的是同一个文件中<strong>代码的同一个位置</strong>，那么，把feature1合并到feature2时，就会产生冲突。这个冲突需要人工解决。步骤如下：</p>
<p>（1）手动修改文件：手动修改冲突的那个文件，决定到底要用哪个分支的代码。</p>
<p>（2）git add：解决好冲突后，输入<code>git status</code>，会提示<code>Unmerged paths</code>。这个时候，输入<code>git add</code>即可，表示：<strong>修改冲突成功，加入暂存区</strong>。</p>
<p>（3）git commit 提交。</p>
<p>然后，我们可以继续把 feature1 分支合并到 master分支，最后删除feature1、feature2。</p>
<p><strong>注意</strong>：两个分支的同一个文件的不同地方合并时，git会自动合并，不会产生冲突。</p>
<p>比如分支feture1对index.html原来的第二行之前加入了一段代码。<br>分支feature2对index.html在原来的最后一行的后面加入了一段代码。<br>这个时候在对两个分支合并，git不会产生冲突，因为两个分支是修改同一文件的不同位置。<br>git自动合并成功。不管是git自动合并成功，还是在人工解决冲突下合并成功，提交之前，都要对代码进行测试。</p>
<h2 id="日常操作积累"><a href="#日常操作积累" class="headerlink" title="日常操作积累"></a>日常操作积累</h2><h3 id="修改密码（曲线救国）"><a href="#修改密码（曲线救国）" class="headerlink" title="修改密码（曲线救国）"></a>修改密码（曲线救国）</h3><blockquote>
<p>网上查了很久，没找到答案。最终，在cld童鞋的提示下，采取如下方式进行曲线救国。</p>
</blockquote>
<pre class="highlight"><span class="line"><span class="comment"># 设置当前仓库的用户名为空</span></span><br><span class="line">git config  user.name <span class="string">&quot;&quot;</span></span><br></pre>

<p>然后，当我们再输入<code>git pull</code>等命令行时，就会被要求重新输入<em>新的</em>账号密码。此时，密码就可以修改成功了。最后，我们还要输入如下命令，还原当前仓库的用户名：</p>
<pre class="highlight"><span class="line">git config user.name &quot;smyhvae&quot;</span><br></pre>

<h3 id="修改已经push的某次commit的作者信息"><a href="#修改已经push的某次commit的作者信息" class="headerlink" title="修改已经push的某次commit的作者信息"></a>修改已经push的某次commit的作者信息</h3><p>已经push的记录，如果要修改作者信息的话，只能 通过–force命令。我反正是查了很久，但最终还是不敢用公司的仓库尝试。</p>
<p>参考链接：</p>
<ul>
<li><a target="_blank" rel="noopener" href="https://segmentfault.com/q/1010000006999861">git 修改已提交的某一次的邮箱和用户信息</a></li>
</ul>
<p>看最后一条答案。</p>
<ul>
<li><a target="_blank" rel="noopener" href="http://baurine.github.io/2015/08/22/git_update_author.html">修改 git repo 历史提交的 author</a></li>
</ul>
<h3 id="将-branch1的某个commit1合并到branch2当中"><a href="#将-branch1的某个commit1合并到branch2当中" class="headerlink" title="将 branch1的某个commit1合并到branch2当中"></a>将 <code>branch1</code>的某个<code>commit1</code>合并到<code>branch2</code>当中</h3><p>切换到branch2中，然后执行如下命令：</p>
<pre class="highlight"><span class="line">git cherry-pick commit1</span><br></pre>

<h3 id="20190118-修改GitHub已提交的用户名和邮箱"><a href="#20190118-修改GitHub已提交的用户名和邮箱" class="headerlink" title="20190118-修改GitHub已提交的用户名和邮箱"></a>20190118-修改GitHub已提交的用户名和邮箱</h3><p>参考链接：（亲测有效）</p>
<ul>
<li><p><a target="_blank" rel="noopener" href="https://cloud.tencent.com/developer/article/1352623">修改Git全部Commit提交记录的用户名Name和邮箱Email</a></p>
</li>
<li><p><a target="_blank" rel="noopener" href="https://blog.csdn.net/yusufolu9/article/details/53706269">Mac 运行sh文件，也就是传说中的shell脚本</a></p>
</li>
</ul>
<p>在执行<code>./email.sh</code>后，如果出现<code>permission denied</code>的错误，可以先执行<code>chmod 777 email.sh</code>，修改文件的权限。</p>
<h3 id="20200520-将Git-项目迁移到另一个仓库"><a href="#20200520-将Git-项目迁移到另一个仓库" class="headerlink" title="20200520-将Git 项目迁移到另一个仓库"></a>20200520-将Git 项目迁移到另一个仓库</h3><p>我们假设旧仓库的项目名称叫<code>old-repository</code>，新仓库的项目名称叫<code>new-repository</code>。操作如下：</p>
<p>（1）创建旧仓库的裸克隆：</p>
<pre class="highlight"><span class="line">git <span class="built_in">clone</span> --bare https://github.com/exampleuser/old-repository.git</span><br></pre>
<p>执行上述命令后，会在本地生成一个名叫 <code>old-repository.git</code>的文件夹。</p>
<p>（2）迁移到新仓库：</p>
<pre class="highlight"><span class="line"><span class="built_in">cd</span> old-repository.git</span><br><span class="line"></span><br><span class="line">git push --mirror https://github.com/exampleuser/new-repository.git</span><br></pre>

<p>这样的话，项目就已经迁移到新仓库了。</p>
<p>注意，我们<strong>不需要</strong>手动新建一个空的新仓库，当我们执行上述命令之后，新仓库就已经自动创建好了。</p>
<p>参考链接：</p>
<ul>
<li><p><a target="_blank" rel="noopener" href="https://help.github.com/cn/github/creating-cloning-and-archiving-repositories/duplicating-a-repository">复制仓库</a></p>
</li>
<li><p><a target="_blank" rel="noopener" href="https://moelove.info/2016/12/04/Git-%E6%9C%AC%E5%9C%B0%E4%BB%93%E5%BA%93%E5%92%8C%E8%A3%B8%E4%BB%93%E5%BA%93/">Git 本地仓库和裸仓库</a></p>
</li>
</ul>
<h3 id="2021-11-10-提交代码时，绕过-eslint-检查"><a href="#2021-11-10-提交代码时，绕过-eslint-检查" class="headerlink" title="2021-11-10-提交代码时，绕过 eslint 检查"></a>2021-11-10-提交代码时，绕过 eslint 检查</h3><p>需求：提交代码时，绕过 eslint 检查</p>
<p>解决办法：用命令行提交，末尾追加<code>--no-verify</code>。例如：</p>
<pre class="highlight"><span class="line"><span class="comment"># 提交代码</span></span><br><span class="line">git commit -m <span class="string">&#x27;千古壹号的commit备注&#x27;</span> --no-verify</span><br><span class="line"></span><br><span class="line"><span class="comment"># 推送到远程时，也可以追加 --no-verify，以免远程仓库做了 eslint 限制。</span></span><br><span class="line">git push origin --no-verify</span><br></pre>

<h3 id="2021-12-29-切换仓库的源地址"><a href="#2021-12-29-切换仓库的源地址" class="headerlink" title="2021-12-29-切换仓库的源地址"></a>2021-12-29-切换仓库的源地址</h3><p>查看源地址：</p>
<pre class="highlight"><span class="line">git remote -v</span><br></pre>

<p>切换源地址：</p>
<pre class="highlight"><span class="line">git remote set-url origin https://xxx.git</span><br></pre>




<h2 id="git客户端推荐"><a href="#git客户端推荐" class="headerlink" title="git客户端推荐"></a>git客户端推荐</h2><p>市面上的Git客户端我基本都用过了，我最推荐的一款Git客户端是：<a target="_blank" rel="noopener" href="https://www.git-tower.com/">Tower</a> 或者 <a target="_blank" rel="noopener" href="https://git-fork.com/">Fork</a>。</p>
<ul>
<li>GitUp：<a target="_blank" rel="noopener" href="https://gitup.co/">https://gitup.co/</a></li>
</ul>
<p>20180623时，网上看了下Git客户端的推荐排名：</p>
<p><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="http://img.smyhvae.com/20180623_1210.png" class="lozad post-image"src="http://img.smyhvae.com/20180623_1210.png"></p>
<p><strong>SmartGit</strong>：</p>
<p>商业用途收费， 个人用户免费：</p>
<p><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="http://img.smyhvae.com/20180623_1305.png" class="lozad post-image"src="http://img.smyhvae.com/20180623_1305.png"></p>
<h2 id="推荐书籍"><a href="#推荐书籍" class="headerlink" title="推荐书籍"></a>推荐书籍</h2><ul>
<li>《pro.git中文版》</li>
</ul>
<h2 id="推荐连接"><a href="#推荐连接" class="headerlink" title="推荐连接"></a>推荐连接</h2><h3 id="2018-06"><a href="#2018-06" class="headerlink" title="2018-06"></a>2018-06</h3><ul>
<li><a target="_blank" rel="noopener" href="https://www.cnblogs.com/wangiqngpei557/p/6056624.html">聊下git pull –rebase</a></li>
</ul>
<h2 id="赞赏作者"><a href="#赞赏作者" class="headerlink" title="赞赏作者"></a>赞赏作者</h2><p>创作不易，你的赞赏和认可，是我更新的最大动力：</p>
<p><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="https://img.smyhvae.com/20220401_1800.jpg" class="lozad post-image"src="https://img.smyhvae.com/20220401_1800.jpg"></p>

  </div>
  <div>
    
      <div 
        class="post-note note-warning copyright" 
        style="margin-top: 42px">
        <p>
          <span style="font-weight: bold;">作者：</span><a 
            target="_blank" 
            rel="nofollow noopener noreferrer" 
            href="/about">
            zwl5670
          </a>
        </p>
        <p>
          <span style="font-weight: bold;">文章链接：</span><a 
            target="_blank" 
            rel="nofollow noopener noreferrer" 
            href="https://zwl5670.gitee.io/2000/01/01/00-%E5%89%8D%E7%AB%AF%E5%B7%A5%E5%85%B7/02-Git%E7%9A%84%E4%BD%BF%E7%94%A8/">
            https://zwl5670.gitee.io/2000/01/01/00-%E5%89%8D%E7%AB%AF%E5%B7%A5%E5%85%B7/02-Git%E7%9A%84%E4%BD%BF%E7%94%A8/
          </a>
        </p>
        <p><span style="font-weight: bold;">版权声明：</span>本博客所有文章除特别声明外，均采用<a target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">CC BY-NC-SA 4.0 协议</a>。转载请注明出处！</p>
      </div>
    
  </div>
</article>
<div class="nav">
  
    <div class="nav-item-prev">
      <a 
        href="/2000/01/01/00-%E5%89%8D%E7%AB%AF%E5%B7%A5%E5%85%B7/04-%E8%A7%A3%E5%86%B3%20Git%20%E4%B8%8D%E5%8C%BA%E5%88%86%E5%A4%A7%E5%B0%8F%E5%86%99%E5%AF%BC%E8%87%B4%E7%9A%84%E6%96%87%E4%BB%B6%E5%86%B2%E7%AA%81%E9%97%AE%E9%A2%98/" 
        class="nav-link">
        <i class="iconfont icon-left nav-prev-icon"></i>
        <div>
          <div class="nav-label">上一篇</div>
          
            <div class="nav-title">04-解决 Git 不区分大小写导致的文件冲突问题 </div>
          
        </div>
      </a>
    </div>
  
  
    <div class="nav-item-next">
      <a 
        href="/2000/01/01/00-%E5%89%8D%E7%AB%AF%E5%B7%A5%E5%85%B7/GitHub%E7%9A%84%E4%BD%BF%E7%94%A8/" 
        class="nav-link">
        <div>
          <div class="nav-label">下一篇</div>
          
            <div class="nav-title">GitHub的使用 </div>
          
        </div>
        <i class="iconfont icon-right nav-next-icon"></i>
      </a>
    </div>
  
</div>

<div 
  class="card card-content toc-card" 
  id="mobiletoc">
  <div class="toc-header">
  <i 
    class="iconfont icon-menu" 
    style="padding-right: 2px;">
  </i>目录
</div>
<ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%B8%B8%E8%A7%81%E6%93%8D%E4%BD%9C"><span class="toc-text">常见操作</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%85%A8%E5%B1%80%E9%85%8D%E7%BD%AE%E7%94%A8%E6%88%B7%E4%BF%A1%E6%81%AF"><span class="toc-text">全局配置用户信息</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%88%86%E6%94%AF%E7%9A%84%E5%90%88%E5%B9%B6"><span class="toc-text">分支的合并</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%9C%BA%E6%99%AF%EF%BC%9A%E5%9F%BA%E4%BA%8Emaster%E5%88%86%E6%94%AF%E7%9A%84%E4%BB%A3%E7%A0%81%EF%BC%8C%E5%BC%80%E5%8F%91%E4%B8%80%E4%B8%AA%E6%96%B0%E7%9A%84%E7%89%B9%E6%80%A7"><span class="toc-text">场景：基于master分支的代码，开发一个新的特性</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%90%88%E5%B9%B6%E5%88%86%E6%94%AF%E6%97%B6%EF%BC%8C%E5%A6%82%E6%9E%9C%E5%AD%98%E5%9C%A8%E5%88%86%E5%8F%89"><span class="toc-text">合并分支时，如果存在分叉</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E8%A7%A3%E5%86%B3%E5%90%88%E5%B9%B6%E6%97%B6%E5%8F%91%E7%94%9F%E7%9A%84%E5%86%B2%E7%AA%81"><span class="toc-text">解决合并时发生的冲突</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%97%A5%E5%B8%B8%E6%93%8D%E4%BD%9C%E7%A7%AF%E7%B4%AF"><span class="toc-text">日常操作积累</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%BF%AE%E6%94%B9%E5%AF%86%E7%A0%81%EF%BC%88%E6%9B%B2%E7%BA%BF%E6%95%91%E5%9B%BD%EF%BC%89"><span class="toc-text">修改密码（曲线救国）</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%BF%AE%E6%94%B9%E5%B7%B2%E7%BB%8Fpush%E7%9A%84%E6%9F%90%E6%AC%A1commit%E7%9A%84%E4%BD%9C%E8%80%85%E4%BF%A1%E6%81%AF"><span class="toc-text">修改已经push的某次commit的作者信息</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%B0%86-branch1%E7%9A%84%E6%9F%90%E4%B8%AAcommit1%E5%90%88%E5%B9%B6%E5%88%B0branch2%E5%BD%93%E4%B8%AD"><span class="toc-text">将 branch1的某个commit1合并到branch2当中</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#20190118-%E4%BF%AE%E6%94%B9GitHub%E5%B7%B2%E6%8F%90%E4%BA%A4%E7%9A%84%E7%94%A8%E6%88%B7%E5%90%8D%E5%92%8C%E9%82%AE%E7%AE%B1"><span class="toc-text">20190118-修改GitHub已提交的用户名和邮箱</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#20200520-%E5%B0%86Git-%E9%A1%B9%E7%9B%AE%E8%BF%81%E7%A7%BB%E5%88%B0%E5%8F%A6%E4%B8%80%E4%B8%AA%E4%BB%93%E5%BA%93"><span class="toc-text">20200520-将Git 项目迁移到另一个仓库</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#2021-11-10-%E6%8F%90%E4%BA%A4%E4%BB%A3%E7%A0%81%E6%97%B6%EF%BC%8C%E7%BB%95%E8%BF%87-eslint-%E6%A3%80%E6%9F%A5"><span class="toc-text">2021-11-10-提交代码时，绕过 eslint 检查</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#2021-12-29-%E5%88%87%E6%8D%A2%E4%BB%93%E5%BA%93%E7%9A%84%E6%BA%90%E5%9C%B0%E5%9D%80"><span class="toc-text">2021-12-29-切换仓库的源地址</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#git%E5%AE%A2%E6%88%B7%E7%AB%AF%E6%8E%A8%E8%8D%90"><span class="toc-text">git客户端推荐</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%8E%A8%E8%8D%90%E4%B9%A6%E7%B1%8D"><span class="toc-text">推荐书籍</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%8E%A8%E8%8D%90%E8%BF%9E%E6%8E%A5"><span class="toc-text">推荐连接</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#2018-06"><span class="toc-text">2018-06</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E8%B5%9E%E8%B5%8F%E4%BD%9C%E8%80%85"><span class="toc-text">赞赏作者</span></a></li></ol>
</div>
            </main>
            <aside class="right-column">
              <div class="sticky-widescreen">
  
  
    <article class="card card-content toc-card">
      <div class="toc-header">
  <i 
    class="iconfont icon-menu" 
    style="padding-right: 2px;">
  </i>目录
</div>
<ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%B8%B8%E8%A7%81%E6%93%8D%E4%BD%9C"><span class="toc-text">常见操作</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%85%A8%E5%B1%80%E9%85%8D%E7%BD%AE%E7%94%A8%E6%88%B7%E4%BF%A1%E6%81%AF"><span class="toc-text">全局配置用户信息</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%88%86%E6%94%AF%E7%9A%84%E5%90%88%E5%B9%B6"><span class="toc-text">分支的合并</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%9C%BA%E6%99%AF%EF%BC%9A%E5%9F%BA%E4%BA%8Emaster%E5%88%86%E6%94%AF%E7%9A%84%E4%BB%A3%E7%A0%81%EF%BC%8C%E5%BC%80%E5%8F%91%E4%B8%80%E4%B8%AA%E6%96%B0%E7%9A%84%E7%89%B9%E6%80%A7"><span class="toc-text">场景：基于master分支的代码，开发一个新的特性</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%90%88%E5%B9%B6%E5%88%86%E6%94%AF%E6%97%B6%EF%BC%8C%E5%A6%82%E6%9E%9C%E5%AD%98%E5%9C%A8%E5%88%86%E5%8F%89"><span class="toc-text">合并分支时，如果存在分叉</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E8%A7%A3%E5%86%B3%E5%90%88%E5%B9%B6%E6%97%B6%E5%8F%91%E7%94%9F%E7%9A%84%E5%86%B2%E7%AA%81"><span class="toc-text">解决合并时发生的冲突</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%97%A5%E5%B8%B8%E6%93%8D%E4%BD%9C%E7%A7%AF%E7%B4%AF"><span class="toc-text">日常操作积累</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%BF%AE%E6%94%B9%E5%AF%86%E7%A0%81%EF%BC%88%E6%9B%B2%E7%BA%BF%E6%95%91%E5%9B%BD%EF%BC%89"><span class="toc-text">修改密码（曲线救国）</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%BF%AE%E6%94%B9%E5%B7%B2%E7%BB%8Fpush%E7%9A%84%E6%9F%90%E6%AC%A1commit%E7%9A%84%E4%BD%9C%E8%80%85%E4%BF%A1%E6%81%AF"><span class="toc-text">修改已经push的某次commit的作者信息</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%B0%86-branch1%E7%9A%84%E6%9F%90%E4%B8%AAcommit1%E5%90%88%E5%B9%B6%E5%88%B0branch2%E5%BD%93%E4%B8%AD"><span class="toc-text">将 branch1的某个commit1合并到branch2当中</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#20190118-%E4%BF%AE%E6%94%B9GitHub%E5%B7%B2%E6%8F%90%E4%BA%A4%E7%9A%84%E7%94%A8%E6%88%B7%E5%90%8D%E5%92%8C%E9%82%AE%E7%AE%B1"><span class="toc-text">20190118-修改GitHub已提交的用户名和邮箱</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#20200520-%E5%B0%86Git-%E9%A1%B9%E7%9B%AE%E8%BF%81%E7%A7%BB%E5%88%B0%E5%8F%A6%E4%B8%80%E4%B8%AA%E4%BB%93%E5%BA%93"><span class="toc-text">20200520-将Git 项目迁移到另一个仓库</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#2021-11-10-%E6%8F%90%E4%BA%A4%E4%BB%A3%E7%A0%81%E6%97%B6%EF%BC%8C%E7%BB%95%E8%BF%87-eslint-%E6%A3%80%E6%9F%A5"><span class="toc-text">2021-11-10-提交代码时，绕过 eslint 检查</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#2021-12-29-%E5%88%87%E6%8D%A2%E4%BB%93%E5%BA%93%E7%9A%84%E6%BA%90%E5%9C%B0%E5%9D%80"><span class="toc-text">2021-12-29-切换仓库的源地址</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#git%E5%AE%A2%E6%88%B7%E7%AB%AF%E6%8E%A8%E8%8D%90"><span class="toc-text">git客户端推荐</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%8E%A8%E8%8D%90%E4%B9%A6%E7%B1%8D"><span class="toc-text">推荐书籍</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%8E%A8%E8%8D%90%E8%BF%9E%E6%8E%A5"><span class="toc-text">推荐连接</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#2018-06"><span class="toc-text">2018-06</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E8%B5%9E%E8%B5%8F%E4%BD%9C%E8%80%85"><span class="toc-text">赞赏作者</span></a></li></ol>
    </article>
  
  
  <article class="card card-content">
    <div class="recent-posts-card">
  <div class="recent-posts-header">
    <i 
      class="iconfont icon-wenzhang_huaban" 
      style="padding-right: 2px;">
    </i>最近文章
  </div>
  <div class="recent-posts-list">
    
      <div class="recent-posts-item">
        <div class="recent-posts-item-title">2023-03-09</div>
        <a href="/2023/03/09/13-React%E5%9F%BA%E7%A1%80/11-React%20Navive%E5%88%9D%E8%AF%86/"><div class="recent-posts-item-content">11-React Navive初识</div></a>
      </div>
    
      <div class="recent-posts-item">
        <div class="recent-posts-item-title">2023-03-09</div>
        <a href="/2023/03/09/13-React%E5%9F%BA%E7%A1%80/10-AntD%E6%A1%86%E6%9E%B6%E7%9A%84upload%E7%BB%84%E4%BB%B6%E4%B8%8A%E4%BC%A0%E5%9B%BE%E7%89%87%E6%97%B6%E4%BD%BF%E7%94%A8customRequest%E6%96%B9%E6%B3%95%E8%87%AA%E5%AE%9A%E4%B9%89%E4%B8%8A%E4%BC%A0%E8%A1%8C%E4%B8%BA/"><div class="recent-posts-item-content">10-AntD框架的upload组件上传图片时使用customRequest方法自定义上传行为</div></a>
      </div>
    
      <div class="recent-posts-item">
        <div class="recent-posts-item-title">2023-03-09</div>
        <a href="/2023/03/09/13-React%E5%9F%BA%E7%A1%80/09-AntD%E6%A1%86%E6%9E%B6%E7%9A%84upload%E7%BB%84%E4%BB%B6%E4%B8%8A%E4%BC%A0%E5%9B%BE%E7%89%87%E6%97%B6%E9%81%87%E5%88%B0%E7%9A%84%E4%B8%80%E4%BA%9B%E5%9D%91/"><div class="recent-posts-item-content">09-AntD框架的upload组件上传图片时遇到的一些坑</div></a>
      </div>
    
      <div class="recent-posts-item">
        <div class="recent-posts-item-title">2023-03-09</div>
        <a href="/2023/03/09/13-React%E5%9F%BA%E7%A1%80/08-Ant%20Design%E7%9A%84%E5%9F%BA%E6%9C%AC%E4%BD%BF%E7%94%A8/"><div class="recent-posts-item-content">08-Ant Design的基本使用</div></a>
      </div>
    
  </div>
</div>
  </article>
  
  
</div>
            </aside>
          </div>
        </div>
      </div>
    </div>
     
    <footer class="footer">
  <div class="footer-container">
    <div>
      <div class="footer-dsc">
        <span>
          Copyright ©
          
            2023
          
          
        </span>
        &nbsp;
        <a 
          href="/" 
          class="footer-link">
          前端面试
        </a>
      </div>
    </div>

    
      <div class="footer-dsc">
        
          Powered by
          <a 
            href="https://hexo.io/" 
            class="footer-link" 
            target="_blank" 
            rel="nofollow noopener noreferrer">
            &nbsp;Hexo
          </a>
        
        
          <span>&nbsp;|&nbsp;</span>
        
        
          Theme -
          <a 
            href="https://github.com/theme-kaze" 
            class="footer-link" 
            target="_blank"
            rel="nofollow noopener noreferrer">
            &nbsp;Kaze
          </a>
        
      </div>
    
    
    
    
</footer>
 
    
  <a 
    role="button" 
    id="scrollbutton" 
    class="basebutton" 
    aria-label="回到顶部">
    <i class="iconfont icon-arrowleft button-icon"></i>
  </a>

<a 
  role="button" 
  id="menubutton"
  aria-label="menu button"
  class="basebutton">
  <i class="iconfont icon-menu button-icon"></i>
</a>
<a 
  role="button" 
  id="popbutton" 
  class="basebutton" 
  aria-label="控制中心">
  <i class="iconfont icon-expand button-icon"></i>
</a>
<a 
  role="button" 
  id="darkbutton" 
  class="basebutton darkwidget" 
  aria-label="夜色模式">
  <i class="iconfont icon-weather button-icon"></i>
</a>
<a 
  role="button" 
  id="searchbutton" 
  class="basebutton searchwidget" 
  aria-label="搜索">
  <i class="iconfont icon-search button-icon"></i>
</a> 
     
     
     
      <script>
  var addImgLayout = function () {
    var img = document.querySelectorAll('.post-content img')
    var i
    for (i = 0; i < img.length; i++) {
      var wrapper = document.createElement('a')
      wrapper.setAttribute('href', img[i].getAttribute('data-src'))
      wrapper.setAttribute('aria-label', 'illustration')
      wrapper.style.cssText =
        'width: 100%; display: flex; justify-content: center;'
      if (img[i].alt) wrapper.dataset.caption = img[i].alt
      wrapper.dataset.nolink = true
      img[i].before(wrapper)
      wrapper.append(img[i])
      var divWrap = document.createElement('div')
      divWrap.classList.add('gallery')
      wrapper.before(divWrap)
      divWrap.append(wrapper)
    }
    baguetteBox.run('.gallery')
  }
</script>
<script>
  loadScript(
    "/js/lib/lightbox/baguetteBox.min.js",
    addImgLayout
  )
</script>
 
     
     
    <script src="/js/main.js"></script> 
     
    
      <script>
        var addLazyload = function () {
          var observer = lozad('.lozad', {
            load: function (el) {
              el.srcset = el.getAttribute('data-src')
            },
            loaded: function (el) {
              el.classList.add('loaded')
            },
          })
          observer.observe()
        }
      </script>
      <script>
        loadScript('/js/lib/lozad.min.js', addLazyload)
      </script>
    
    <script src="//instant.page/5.1.0" type="module"
      integrity="sha384-by67kQnR+pyfy8yWP4kPO12fHKRLHZPfEsiSXR8u2IKcTdxD805MGUXBzVPnkLHw"></script>
    
    
  </body>
</html>
